
export default {
  data() {
    return {
      loading: false,
      status: 'loadmore'
    }
  },
  methods: {
    async queryList() {
      const res = await this.listModel.reset().queryList()
      this.handleData(res)
    },
  },
  async onReachBottom() {
    if (!this.listModel.hasMoreData) {
      this.status = 'nomore' //后台没有数据了 停止请求
      return
    }
    if (this.loading) return //正在加载数据，就不用反复触发
    this.loading = true //表示正准备发送此次请求
    this.status = 'loading'
    const res = await this.listModel.queryList()
    this.handleData(res)
    this.loading = false //表示此次请求完成结束
  },
  async onPullDownRefresh() {
    await this.queryList()
    uni.stopPullDownRefresh();

  }
}